<template>
	<view>
		<bsNavBar title='资料确认'></bsNavBar>
		<u-cell-group>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="姓名" :value="form.name"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="会员类型" :value="form.declareName"></u-cell-item>

			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="头像">
				<image slot="right-icon" style="width: 100rpx;height: 100rpx;border-radius: 50%;" :src="baseImgUrl+form.picture"
				 mode=""></image>
			</u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="性别" :value="form.sex"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="民族" :value="form.spared1"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="出生年月" :value="form.birthday"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="籍贯" :value="form.nativePlace"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="政治面貌" :value="form.politicalStatus"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="职称" :value="form.jobTitle"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="毕业院校" :value="form.shoolName"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="所学专业" :value="form.professional"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="身份证号码" :value="form.idNumber"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="E-mail" :value="form.emailQq"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="单位名称" :value="form.companyName"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="单位职务" :value="form.position"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="联系电话" :value="form.contactPhone"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="传真" :value="form.faxes"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="手机" :value="form.principalPhone"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="通讯地址" :value="form.companyAddress"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="类别" :value="form.applyCategory"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="工作业绩" :value="form.workPerformance"></u-cell-item>
			<u-cell-item :value-style='valueStyle' :title-style='titleStyle' :arrow='false' title="工作简历" :value="form.jobResume"></u-cell-item>


		</u-cell-group>
		<view class="btn-box">
			<u-button :plain='true' :custom-style="customStyle1" ripple="" type='jz' @click="handGoBack">返回修改</u-button>
			<u-button :custom-style="customStyle2" ripple="" type='jz' @click="submit">提交审核</u-button>
		</view>
	</view>
</template>

<script>
	import {
		baseURL,
		baseImgUrl
	} from '@/config/config.js'
	export default {
		data() {
			return {
				baseImgUrl: baseImgUrl,
				customStyle1: {
					width: '266rpx'
				},
				customStyle2: {
					width: '424rpx'
				},
				titleStyle: {
					fontWeight: "bold",
					color: '#303030',
					fontSize: '28rpx'
				},
				valueStyle: {
					color: '#666666',
					fontSize: '32rpx'
				},
				form: {

				},
				status: ''
			};
		},
		onLoad(e) {
			if (e.form) {
				this.form = JSON.parse(e.form)
				console.log(this.form)
				this.form.applyCategory = JSON.parse(this.form.applyCategory).join(',')
				this.status = e.status
			}
		},
		methods: {
			handGoBack() {
				uni.navigateBack({

				})
			},
			async submit() {
				const userType = this.cache.getCache('userMsg').userType
				this.form.declareType = 2
				this.form.status = 0
				this.form.vipType = userType //先写死--0企业会员 1个人会员
				console.log(this.form, '提交的数据')
				delete this.form.awardId
				// delete this.form.pageUrl
				this.form.applyCategory = JSON.stringify(this.form.applyCategory.split(','))
				if (this.status == 2) {
					let res = await this.$u.api.updateAwardDeclaree(this.form)
				} else {
					let res2 = await this.$u.api.addAwardDeclare(this.form)
				}
				uni.showToast({
					title: '提交成功,请等待审核!',
					success: () => {
						uni.navigateTo({
							url: '/pages/my/authVip/audit'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.btn-box {
		@include my-flex($fw: nowrap, $jc:$bs-sb) background: #FFFFFF;
		box-shadow: 0 0 26px 0 rgba(18, 27, 83, 0.07);
		padding: 20rpx;
		position: fixed;
		bottom: 0;
		width: 100%;
	}
</style>
